package com.itobase.statusDetect.Model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Objects;

/**
 * @author htyu
 * @date 2019/2/23
 */

@Data
@Document
public class Time {

    @Id
    private String id;

    /**
     * 学年
     */
    private String schoolYear;

    /**
     *第一学期或第二学期
     */
    private String term;

    /**
     *第一周起始日
     */
    private String startDate;

    /**
     *学期总周数
     */
    private int weeks;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Time time = (Time) o;
        return weeks == time.weeks &&
                Objects.equals(schoolYear, time.schoolYear) &&
                Objects.equals(term, time.term) &&
                Objects.equals(startDate, time.startDate);
    }
}
